import { btnsModule } from '@renderer/utils/bundle'
import useMainStore from '@renderer/store/modules/useMainStore'
import { useWindowSize } from '@vueuse/core'
import * as PIXI from 'pixi.js'
import { editCardClick } from '@renderer/utils/events'
const { width, height } = useWindowSize()

export default async (): Promise<PIXI.Container<PIXI.ContainerChild>> => {
  const mainStore = useMainStore()
  const { scale } = mainStore.getAppAttr
  const container = new PIXI.Container()
  const sprite = await btnsModule('red')
  sprite.anchor.set(0.5)
  container.scale.set(0.6)
  container.addChild(sprite)
  container.position.set((width.value / scale) * 0.8, (height.value / scale) * 0.8 + container.height * 1.3)
  // 文字
  const text = new PIXI.Text({
    text: ' 编 辑 ',
    alpha: 0.8,
    style: {
      fontFamily: 'RZFont',
      fontSize: 52,
      fill: 0x222222,
      align: 'center',
    },
  })
  text.anchor.set(0.5)
  container.addChild(text)
  editCardClick.whiteAdd(container)
  return container
}
